[Unit]
Description=HBase
Before=
After=network.target

[Service]
User=hbase
ExecStart={{ HBASE_HOME }}/bin/hbase {% if HBASE_MODE == "slave" %}regionserver{% else %}master{% endif %} start{% if HBASE_MODE == "backup" %} -backup{% endif %}

ExecStop=/bin/kill $MAINPID
Restart=on-abort
StandardOutput=journal
EnvironmentFile=/etc/environment
PIDFile={{ PID_DIR }}/hbasemaster.pid

[Install]
WantedBy=multi-user.target